package com.itheima.stock.mapper;

import com.itheima.stock.common.domain.InnerMarketDomain;
import com.itheima.stock.pojo.StockMarketIndexInfo;
import org.apache.ibatis.annotations.Param;

import java.awt.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
* @author 呱呱
* @description 针对表【stock_market_index_info(国内大盘数据详情表)】的数据库操作Mapper
* @createDate 2022-05-30 15:45:59
* @Entity com.itheima.stock.pojo.StockMarketIndexInfo
*/
public interface StockMarketIndexInfoMapper {

    int deleteByPrimaryKey(Long id);

    int insert(StockMarketIndexInfo record);

    int insertSelective(StockMarketIndexInfo record);

    StockMarketIndexInfo selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(StockMarketIndexInfo record);

    int updateByPrimaryKey(StockMarketIndexInfo record);


    /**
     * 根据编码和时间获取国内大盘数据
     *
     * @param marketCodes 市场代码
     * @param timePoint   时间点
     * @return {@link List}<{@link InnerMarketDomain}>
     */
    List<InnerMarketDomain> getInnerMarketInfosByCodesAndTime(@Param("marketCodes") List<String> marketCodes,
                                                              @Param("timePoint") Date timePoint);

    /**
     *   //3.1 查询T日大盘交易统计数据
     *
     * @param markedIds   标记id
     * @param startTime4T 开始time4t
     * @param endTime4T   结束time4t
     * @return {@link List}<{@link Map}>
     */
    List<Map> getStockTradeVol(@Param("markedIds") List<String> markedIds,
                               @Param("startTime") Date startTime4T,
                               @Param("endTime") Date endTime4T);
    /**
     * 批量插入大盘数据信息
     *
     * @param list 列表
     * @return int
     */
    int insertBatch(@Param("infos") List<StockMarketIndexInfo> list);

    /**
     * 获取所有股票的code
     * @return
     */
    List<String> getStockIds();



}
